home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectSound / EffectsBuffers / frmWaves.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-10-08  |  6.2 KB  |  201 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmWaves 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "WavesReverb Effects Update"
  6.    ClientHeight    =   2775
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   2775
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   2775
  14.    ScaleWidth      =   2775
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.CommandButton cmdOK 
  18.       Caption         =   "OK"
  19.       Height          =   315
  20.       Left            =   1800
  21.       TabIndex        =   8
  22.       Top             =   2340
  23.       Width           =   915
  24.    End
  25.    Begin MSComctlLib.Slider sldInGain 
  26.       Height          =   195
  27.       Left            =   60
  28.       TabIndex        =   0
  29.       Top             =   360
  30.       Width           =   2655
  31.       _ExtentX        =   4683
  32.       _ExtentY        =   344
  33.       _Version        =   393216
  34.       LargeChange     =   10
  35.       Min             =   -96
  36.       Max             =   0
  37.       TickFrequency   =   10
  38.    End
  39.    Begin MSComctlLib.Slider sldReverbMix 
  40.       Height          =   195
  41.       Left            =   60
  42.       TabIndex        =   2
  43.       Top             =   900
  44.       Width           =   2655
  45.       _ExtentX        =   4683
  46.       _ExtentY        =   344
  47.       _Version        =   393216
  48.       LargeChange     =   10
  49.       SmallChange     =   2
  50.       Min             =   -96
  51.       Max             =   0
  52.       TickFrequency   =   10
  53.    End
  54.    Begin MSComctlLib.Slider sldReverbTime 
  55.       Height          =   195
  56.       Left            =   60
  57.       TabIndex        =   4
  58.       Top             =   1440
  59.       Width           =   2655
  60.       _ExtentX        =   4683
  61.       _ExtentY        =   344
  62.       _Version        =   393216
  63.       LargeChange     =   100
  64.       SmallChange     =   10
  65.       Min             =   1
  66.       Max             =   3000
  67.       SelStart        =   1
  68.       TickFrequency   =   200
  69.       Value           =   1
  70.    End
  71.    Begin MSComctlLib.Slider sldHighFreq 
  72.       Height          =   195
  73.       Left            =   60
  74.       TabIndex        =   6
  75.       Top             =   1980
  76.       Width           =   2655
  77.       _ExtentX        =   4683
  78.       _ExtentY        =   344
  79.       _Version        =   393216
  80.       LargeChange     =   100
  81.       SmallChange     =   10
  82.       Min             =   1
  83.       Max             =   999
  84.       SelStart        =   1
  85.       TickFrequency   =   50
  86.       Value           =   1
  87.    End
  88.    Begin VB.Label lbl 
  89.       BackStyle       =   0  'Transparent
  90.       Caption         =   "High Freq RT Ratio"
  91.       Height          =   255
  92.       Index           =   4
  93.       Left            =   60
  94.       TabIndex        =   7
  95.       Top             =   1740
  96.       Width           =   1695
  97.    End
  98.    Begin VB.Label lbl 
  99.       BackStyle       =   0  'Transparent
  100.       Caption         =   "Reverb Time"
  101.       Height          =   255
  102.       Index           =   3
  103.       Left            =   60
  104.       TabIndex        =   5
  105.       Top             =   1200
  106.       Width           =   1035
  107.    End
  108.    Begin VB.Label lbl 
  109.       BackStyle       =   0  'Transparent
  110.       Caption         =   "Reverb Mix"
  111.       Height          =   255
  112.       Index           =   0
  113.       Left            =   60
  114.       TabIndex        =   3
  115.       Top             =   660
  116.       Width           =   1275
  117.    End
  118.    Begin VB.Label lbl 
  119.       BackStyle       =   0  'Transparent
  120.       Caption         =   "In Gain"
  121.       Height          =   255
  122.       Index           =   1
  123.       Left            =   60
  124.       TabIndex        =   1
  125.       Top             =   120
  126.       Width           =   735
  127.    End
  128. Attribute VB_Name = "frmWaves"
  129. Attribute VB_GlobalNameSpace = False
  130. Attribute VB_Creatable = False
  131. Attribute VB_PredeclaredId = True
  132. Attribute VB_Exposed = False
  133. Option Explicit
  134. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  135. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  136. '  File:       frmWaves.frm
  137. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  138. Private oBuffer As DirectSoundSecondaryBuffer8
  139. Private mlIndex As Long
  140. Private oFX As DirectSoundFXWavesReverb8
  141. Private Sub SaveAllSettings()
  142.     Dim fxNew As DSFXWAVESREVERB
  143.     'Ok, save these new settings
  144.     'Set the new information up
  145.     With fxNew
  146.         .fInGain = CSng(sldInGain.Value)
  147.         .fReverbMix = CSng(sldReverbMix.Value)
  148.         .fReverbTime = CSng(sldReverbTime.Value)
  149.         .fHighFreqRTRatio = CSng(sldHighFreq.Value / 1000) 'Range is 0.001 - 0.999
  150.     End With
  151.     'Now update the effect
  152.     oFX.SetAllParameters fxNew
  153. End Sub
  154. Private Sub cmdOK_Click()
  155.     SaveAllSettings
  156.     Unload Me
  157. End Sub
  158. Private Sub Form_Load()
  159.     Dim fxCurrent As DSFXWAVESREVERB
  160.     'Get the echo interface
  161.     Set oFX = oBuffer.GetObjectinPath(DSFX_STANDARD_WAVES_REVERB, mlIndex, IID_DirectSoundFXWavesReverb)
  162.     'Get the current settings from it
  163.     fxCurrent = oFX.GetAllParameters
  164.     'Now put them out there
  165.     With fxCurrent
  166.         sldInGain.Value = CLng(.fInGain)
  167.         sldReverbMix.Value = CLng(.fReverbMix)
  168.         sldReverbTime.Value = CLng(.fReverbTime)
  169.         sldHighFreq.Value = CLng(.fHighFreqRTRatio * 1000) 'Range is 0.001 - 0.999
  170.     End With
  171. End Sub
  172. Public Sub SetBuffer(oBuf As DirectSoundSecondaryBuffer8, Index As Long)
  173.     'Store the buffer and index
  174.     Set oBuffer = oBuf
  175.     mlIndex = Index
  176. End Sub
  177. Private Sub sldHighFreq_Change()
  178.     SaveAllSettings
  179. End Sub
  180. Private Sub sldHighFreq_Scroll()
  181.     SaveAllSettings
  182. End Sub
  183. Private Sub sldInGain_Change()
  184.     SaveAllSettings
  185. End Sub
  186. Private Sub sldInGain_Scroll()
  187.     SaveAllSettings
  188. End Sub
  189. Private Sub sldReverbMix_Change()
  190.     SaveAllSettings
  191. End Sub
  192. Private Sub sldReverbMix_Scroll()
  193.     SaveAllSettings
  194. End Sub
  195. Private Sub sldReverbTime_Change()
  196.     SaveAllSettings
  197. End Sub
  198. Private Sub sldReverbTime_Scroll()
  199.     SaveAllSettings
  200. End Sub
  201.